<template>
	<view class="container">
		<pyh-nv :config="config"></pyh-nv>
		<image :src="baseurl+'association/postHeadBg.png'" class="headBg"></image>
		<view class="content">
			<view class="scrollBox">
				<view class="labelBox">
					<view class="line"></view>
					<text class="label">商户名称</text>
				</view>
				<view class="nameBox">
					<input type="text" class="name" v-model="name" placeholder="请输入商户名称" />
				</view>
				<view class="labelBox">
					<view class="line"></view>
					<text class="label">联系人电话</text>
				</view>
				<view class="nameBox">
					<input type="text" class="name" v-model="mobile" maxlength="11" placeholder="请输入联系人电话" />
				</view>
				<view class="labelBox">
					<view class="line"></view>
					<text class="label">创建商家账号</text>
				</view>
				<view class="nameBox">
					<input type="text" class="name" v-model="account" placeholder="请设置商家登录账号(可用手机号代替)" />
				</view>
				<view class="labelBox">
					<view class="line"></view>
					<text class="label">设置商家密码</text>
				</view>
				<view class="nameBox">
					<input type="text" class="name" v-model="password" placeholder="请设置商家密码" />
				</view>
				<view class="agreeBox">
					<image :src="baseurl+'user/disagree.png'" class="disagree" v-if="!isAgree" @click="change()">
					</image>
					<image :src="baseurl+'user/agree.png'" class="disagree" v-else @click="change()"></image>
					<text class="yuedu">我已阅读并同意</text>
					<text class="xieyi" @click="$navto.navto('/packageB/entry_Agreement/entry_Agreement')">《入驻协议》</text>
				</view>
				<view class="submit" @click="submit">
					提交申请
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				baseurl: this.$baseurl,
				config: {
					bgColor: "transparent",
					title: "商家入驻",
					color: '#ffffff'
				},
				isAgree: false,
				name: '',
				mobile: '',
				account: '',
				password: ''
			}
		},
		onLoad(options) {},
		methods: {
			change() {
				this.isAgree = !this.isAgree;
			},
			submit() {

				if (this.name == '') {
					this.$u.toast('请输入商户名称')
					return;
				}
				if (this.mobile == '') {
					this.$u.toast('请输入联系人电话')
					return;
				}
				if (this.account == '') {
					this.$u.toast('请设置商家登录账号')
					return;
				}
				if (this.password === '') {
					this.$u.toast('请设置商家密码')
					return;
				}
				if (this.isAgree == false) {
					this.$u.toast('请阅读并同意入驻协议')
					return;
				}
				this.$request.post(`ShopApply/apply`, {
					name: this.name,
					mobile: this.mobile,
					account: this.account,
					password: this.password,
				}).then(res => {
					this.$u.toast(res.data.msg)
				})
			}
		}
	}
</script>

<style lang="scss">
	.agreeBox {
		margin-top: 60rpx;
		margin-left: 39rpx;
		align-items: center;
		display: flex;

		.yuedu {
			font-size: 28rpx;
			margin-left: 30rpx;
		}

		.xieyi {
			font-size: 28rpx;
			color: #4E97AD;
		}

		.disagree {
			width: 34rpx;
			height: 34rpx;

		}
	}

	.labelBox {
		display: flex;
		margin-top: 60rpx;
		align-items: center;

		.line {
			width: 5rpx;
			background-color: #4E97AD;
			height: 30rpx;
		}

		.label {
			font-size: 30rpx;
			font-family: 700;
			margin-left: 35rpx;
		}
	}

	.headBg {
		width: 100%;
		height: 178rpx;
	}

	.submit {
		width: 500rpx;
		height: 90rpx;
		border-radius: 45rpx;
		margin-left: 125rpx;
		margin-top: 100rpx;
		font-size: 28rpx;
		text-align: center;
		color: #FAFAFA;
		line-height: 90rpx;
		background-color: #4E97AD;
	}

	.idcardBox {
		width: 674rpx;
		height: 88rpx;
		margin-top: 115rpx;
		margin-left: 39rpx;
		border-radius: 10rpx;
		display: flex;
		align-items: center;
		background-color: #fff;

		.name {
			width: 100%;
			height: 100%;
			margin-left: 10rpx;
			border: none;
			text-align: left;
			font-size: 26rpx;
			color: #000000;
		}
	}

	.nameBox1 {
		width: 674rpx;
		height: 88rpx;
		margin-top: 115rpx;
		margin-left: 39rpx;
		border-radius: 10rpx;
		display: flex;
		align-items: center;
		background-color: #fff;

		.name {
			width: 100%;
			height: 100%;
			margin-left: 10rpx;
			border: none;
			text-align: left;
			font-size: 26rpx;
			color: #000000;
		}
	}

	.nameBox {
		width: 674rpx;
		height: 88rpx;
		margin-top: 35rpx;
		margin-left: 39rpx;
		border-radius: 10rpx;
		display: flex;
		align-items: center;
		background-color: #fff;

		.name {
			width: 100%;
			height: 100%;
			margin-left: 10rpx;
			border: none;
			text-align: left;
			font-size: 26rpx;
			color: #000000;
		}
	}

	.telBox {
		position: relative;
		width: 674rpx;
		height: 88rpx;
		margin-top: 115rpx;
		margin-left: 39rpx;
		border-radius: 10rpx;
		display: flex;
		align-items: center;
		background-color: #fff;

		.tel {
			position: absolute;
			width: 100%;
			height: 100%;
			left: 10rpx;
			border: none;
			text-align: left;
			font-size: 26rpx;
			color: #000000;
		}
	}


	.timeBox,
	.renshuBox {
		width: 674rpx;
		height: 82rpx;
		margin-left: 39rpx;
		margin-top: 120rpx;
		background-color: #ffffff !important;
		border-radius: 10rpx;
		padding-left: 10rpx;

		.renshu {
			margin-left: 35rpx;
			width: 100%;
			height: 100%;
			font-size: 22rpx;
			text-align: left;
			color: #fff;
		}

		.uni-stat__select {
			height: 100% !important;
			width: 96%;
		}

		.uni-select {
			padding: 0;
			padding-left: 0;
			border: none !important;
		}

		.uni-select__input-placeholder {
			color: #fff;
			text-align: left;

		}

		.uni-icons {
			display: none;
		}

		.uni-select__input-text {
			color: #000 !important;
			text-align: left;
		}
	}



	.menuBox {
		position: absolute;
		width: 670rpx;
		height: 90rpx;
		background-color: #C49A69;
		margin-top: 1330rpx;
		left: 40rpx;

		.menuText {
			width: 100%;
			height: 100%;
			line-height: 90rpx;
			text-align: center;
			font-size: 30rpx;
			color: #ffffff;
		}
	}


	.scrollBox {
		position: fixed;
		width: 100%;
		height: 100vh;
		overflow-y: scroll;
	}

	.container {
		position: fixed;
		width: 100%;
		height: 100vh;
		overflow-y: hidden;
		background-color: #F5F7FB;
		overflow-x: hidden;
	}

	.bg {
		position: absolute;
		width: 750rpx;
		height: 1623rpx;
		left: 0;
		top: 0;
	}

	.pyh-nv-box {
		position: absolute !important;
	}

	.content {
		position: fixed;
		width: 100%;
		height: 100vh;
		overflow: hidden;
	}
</style>